﻿<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="system_documentcategorylist" Codefile="documentcategorylist.aspx.cs" %>

<%@ Register Src="~/admin/_root/_controls/ctlNavBar.ascx" TagName="ctlNavBar" TagPrefix="uc1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>

    <script type="text/javascript">
     var LOCID_POPUP_MENU_LABEL ="{0}菜单";
    var LOCID_UNRECOGNIZE_DOTC="{0} 不是可识别的对象类型。";
    var LOCID_COPY_SHORTCUT_ERROR="无法将此快捷方式复制到剪贴板。";
    var LOCID_ENTER_VALID_NUMBER ="必须输入有效的数字。";

    //Lookup(global、lookup)
    var LOCID_LU_SELECT_VALUE_FOR="单击以选择{0}的值。";
    var LOCID_LU_SELECT_VALUE="单击以选择值。";
    var LOCID_LU_LOOKUPUNRESOLVEDTOOLTIP="未找到任何匹配项";
    var LOCID_LU_LOOKUPAMBIGUOUSTOOLTIP="已找到多个匹配项";
    var LOCID_UI_DIR="LTR";
    var LOCID_DIALOG_OFFSET_WIDTH=0;
    var LOCID_DIALOG_OFFSET_HEIGHT=0;
    var LOCID_ERROR_DIALOG_WIDTH=550;
    var LOCID_ERROR_DIALOG_HEIGHT=260;
    var LOCID_CONTRACTS_TDIALOG_WIDTH=350;
    var LOCID_CONTRACTS_TDIALOG_HEIGHT =350;
    var LOCID_LOOKUPSTYLE_NOT_SET="未知的查找样式。请检查属性 XML 的设置是否正确。";
    var LOCID_LOOKUPAMBIGUOUSTITLE="已找到多个匹配项:";
    var LOCID_LOOKMORERECORDS_AMBIGUOUS="查找更多记录";
    var DEFAULT_USER_NUMBER_FORMAT_MASK="\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var USER_NUMBER_FORMAT_MASK="\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";

    // Calendar Control
    var LOCID_SHOW_WEEK_CAL_WIDTH="170";
    var LOCID_NO_WEEK_CAL_WIDTH="150";
    var LOCID_CALENDAR_HEIGHT="163";
    var USER_SHOW_WEEK_NUMBER=false;
    var USER_IS_GREGORIANCALENDAR=true;
    var ORG_DATE_START_DAY ="0";
    var USER_DATE_SEPARATOR="-";
    var USER_DATE_FORMATSTRING="yyyy/M/d";
    var LOCID_ALERT_ENTER_VALID_DATE="指定的日期格式无效或日期超出了有效范围。请按以下格式输入有效的日期: {0}";
    var USER_DATE_FORMATTED_FORMATSTRING="yyyy/M/d";
    var LOCID_YEAR_DISPLAYFORMAT="{0}{1} 年";
    var LOCID_ARRAY_SHORT_MONTHS="1 月,2 月,3 月,4 月,5 月,6 月,7 月,8 月,9 月,10 月,11 月,12 月";
    var LOCID_ARRAY_LONG_MONTHS="一月,二月,三月,四月,五月,六月,七月,八月,九月,十月,十一月,十二月,";
    var LOCID_ARRAY_SHORTEST_DAYS="日,一,二,三,四,五,六";
    var LOCID_ARRAY_LONG_DAYS ="星期日,星期一,星期二,星期三,星期四,星期五,星期六";
    var LOCID_SHOW_WEEK_CAL_WIDTH="170";
    var LOCID_NO_WEEK_CAL_WIDTH="150";
    var LOCID_CALENDAR_HEIGHT="163";
    var LOCID_TODAY_DATE_FORMAT_MASK="今天:{0}";
    var LOCID_ALERT_CALDATE_FAIL="获取日期时出错";
    var LOCID_ALERT_ACTUAL_DATE_FAIL="获取日期时出错";
    var LOCID_DTM_BLANK_DATE_ERROR="必须提供日期。";

    //action
    var LOCID_NO_ASTERISK="搜索字段不得包含星号 (*) 字符。请移除任何使用过的字符，然后重试。";

    //Grid
    var LOCID_GRID_SELECT_ALL_KEY = "A";
    var LOCID_LOADING_GRID_DATA ="Loading Data...";
    var LOCID_REFRESH_GRID_CANCELLED ="刷新已取消。";
    var LOCID_LOADING_GRID_FAILED ="网格刷新失败。";
    var LOCID_ALT_COLUMNSORTORDER_DOWN ="数据按降序存储在该列中";
    var LOCID_ALT_COLUMNSORTORDER_UP ="数据按升序存储在该列中";
    
    /* 自定义排序 */
    var LOCID_VARIABLE_FILTER="flipv()"; //刷新前状态
    var LOCID_VARIABLE_FIELDNAME=""; //所选列列名
    var LOCID_VARIABLE_FIELD=""; //排序字段
    var LOCID_VARIABLE_LEVEL=""; //排序级别
    var LOCID_VARIABLE_OLDFIELDNAME="";
    
    var WEB_APP_URL = "";
    var HELP_SKU = "OP";
    var _currentTypeCode = 1084;
    var IS_LIVE = false;
    var IS_PATHBASEDURLS = true;
    var ORG_UNIQUE_NAME = "webs";
    var _ErrorCodesIsvAborted = "0x80040265";
    var ScriptErrorReportingPreference = 1;
    var ScriptErrorStatusBar = "\u7f51\u9875\u4e0a\u6709\u9519\u8bef\u3002";
    var _bPresenceEnabled = true;
    var ORG_DATE_FORMATSTRING = "yyyy\x2fM\x2fd";
    var ORG_IS_GREGORIANCALENDAR = false;
    var ORG_DATE_SEPARATOR = "-";
    var ORG_DATE_START_DAY = 0;
    var ORG_LANGUAGE_CODE = 2052;
    var ORG_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var ORG_TIME_FORMAT = 0;
    var ORG_SHOW_WEEK_NUMBER = false;
    var ORG_NUMBER_DECIMAL_SEPARATOR = ".";
    var ORG_NUMBER_GROUP_SEPARATOR = ",";
    var AUTHENTICATION_TYPE = 0;
    var ORG_TIMEZONE_OFFSET = 480;
    var USER_DATE_FORMATSTRING = "yyyy\x2fM\x2fd";
    var USER_IS_GREGORIANCALENDAR = true;
    var USER_DATE_SEPARATOR = "-";
    var USER_DATE_FORMATTED_FORMATSTRING = "yyyy\x2fM\x2fd";
    var DEFAULT_USER_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var USER_LANGUAGE_CODE = 2052;
    var USER_HELP_LCID = "2052";
    var USER_NUMBER_FORMAT_MASK = "\x23,\x23\x230.\x2a\x3b\x7e\x23,\x23\x230.\x2a";
    var USER_TIME_FORMAT = "H\x3amm";
    var USER_SHOW_WEEK_NUMBER = false;
    var USER_NUMBER_DECIMAL_SEPARATOR = ".";
    var USER_NUMBER_GROUP_SEPARATOR = ",";
    var HELP_SERVER_URL = "";
    </script>

    <script type="text/javascript" src="../_static/_common/scripts/encodedecode.js"></script>

    <script type="text/javascript" src="../_static/_controls/util/util.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/global.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/xmlutil.js"></script>

    <script type="text/javascript" src="../_static/_controls/remotecommands/remotecommand.js"></script>

    <script type="text/javascript" src="../_common/windowinformation/windowinformation.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/stage.js"></script>

    <script type="text/javascript" src="../_static/crmreports/reports.js"></script>

    <script type="text/javascript" src="../_static/_common/scripts/presence.js"></script>

    <script type="text/javascript" src="../_static/_controls/lookup/lookup.js"></script>

    <script type="text/javascript" src="../_static/_grid/action.js"></script>

    <script type="text/javascript" src="../_static/_forms/addrelated.js"></script>

    <script type="text/javascript" src="../_static/_controls/datetime/date.js"></script>

    <script type="text/javascript" src="../_static/_controls/datetime/time.js"></script>

    <script type="text/javascript" src="../_static/_jQuery/jquery-1.3.2.min.js"></script>

    <link rel="stylesheet" type="text/css" href="../_common/styles/global.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/global-styles.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/global-dynamic-styles.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/fonts.css" />
    <link rel="stylesheet" type="text/css" href="../_forms/controls/controls.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/select.css" />
    <link rel="stylesheet" type="text/css" href="../_common/styles/minical.css" />
    <link rel="stylesheet" type="text/css" href="../_nav/menu.css" />
    <link rel="stylesheet" type="text/css" href="../_controls/notifications/notifications.css" />
    <link rel="stylesheet" type="text/css" href="../_grid/appgrid.css" />

    <script type="text/javascript">
    function window.onload()
    {
        LoadingData();
	}
	function LocalDateTimeNow() 
    {
        var dNow = new Date();
        dNow.setMinutes(dNow.getMinutes() + (dNow.getTimezoneOffset()) + ORG_TIMEZONE_OFFSET);
        return dNow; 
    }
    var pageIndex = "";
    function pagination(index)
    {
        pageIndex = index;
        LoadingData();
    }
    function LoadingData()
    {
        $.ajax({
               type:    "POST",
               url:     "documentcategorylist.aspx",
               data:    {
                        otype:            "loaddata",
                        index:            pageIndex,
                        systemviews:      document.getElementById("selSystemViews").value,
                        field:      LOCID_VARIABLE_FIELD,
                        level:      LOCID_VARIABLE_LEVEL
               },
               beforeSend:function(){
                    $("#divloading").css("display","block");
                    $("#divItemsList").html('');
               },
               success: function(res, textStatus){
                    $("#divloading").css("display","none");
                    $("#divItemsList").html(res);
               }
          }); 
    }
    function Lookup()
    {
        pageIndex = "";
        LoadingData();
    }
    function OpenDia(otype)
    {
        /// 修改模式
        if(otype == "modify")
        {
            var oTr = getSelectedOTr("crmGrid", getSelected("crmGrid")[0]);
            if(oTr)
            {
                openStdWin(prependOrgName("/system/documentcategoryeditor.aspx?categoryid="+CrmEncodeDecode.CrmUrlEncode(oTr.oid)+"&otype=modify"), buildWinName(), 528, 285); 
            }
            else
            {
                alert("请先选中记录!");
            }
        }
        if(otype == "add")
        {
            openStdWin(prependOrgName("/system/documentcategoryeditor.aspx?otype=add"), buildWinName(), 528, 285);
        }
    }
    function DoAction(otype)
    {
        var oTr = getSelectedOTr("crmGrid", getSelected("crmGrid")[0]);
        if(oTr)
        {
            if(confirm("您确定删除所选记录?"))
            {
                $.post(
                   "documentcategorylist.aspx",
                   {    
                        otype:      'delete',
                        categoryid:     oTr.oid
                   },
                   function(res){        
                        if (res == "succeeded")
                        {
                            res = "删除成功!";
                            LoadingData();
                        }
                        else
                            alert(res);
                   }
                );
            }
        }
        else
        {
            alert("请先选中记录!");
        }
    }
    </script>

</head>
<body class="stage">
    <form id="form1" runat="server">
        <table class="stdTable" cellspacing="0" cellpadding="0">
            <colgroup>
                <col />
            </colgroup>
            <tr style="height: 34px;">
                <td style="background: url('../_imgs/deskop_nav_bar_bg.gif') repeat-x;">
                    <uc1:ctlNavBar ID="CtlNavBar1" runat="server" />
                </td>
            </tr>
            <tr class="ms-crm-Form-Background" height="100%">
                <td id="tdAreas" style="padding: 5px 10px 10px 15px;">
                    <table class="stdTable" cellpadding="0" cellspacing="0">
                        <tr height="25">
                            <td>
                                <table class="homepage_table" cellspacing="0" cellpadding="0" width="100%">
                                    <colgroup>
                                        <col width="20" />
                                        <col />
                                        <col width="20%" />
                                        <col width="80%" />
                                    </colgroup>
                                    <tbody>
                                        <tr>
                                            <td align="middle">
                                            </td>
                                            <td class="homepage_td" nowrap>
                                                <span style="font-weight: bold; color: #000000">条目类型:</span></td>
                                            <td>
                                                <select class="ms-crm-SelectBox" id="selSystemViews" name="selSystemViews">
                                                    <option value="">-- 按类型查询 --</option>
                                                    <option value="1">文件类别</option>
                                                    <option value="2">文件来源</option>
                                                    <option value="3">来文单位</option>
                                                    <option value="5">发文单位</option>
                                                    <option value="4">文件密级</option>
                                                    <option value="6">发文签发领导</option>
                                                </select>
                                            </td>
                                            <td>
                                                <button id="btnSearch" onclick="Lookup();">
                                                    查询
                                                </button>
                                            </td>
                                        </tr>
                                    </tbody>
                                </table>
                            </td>
                        </tr>
                        <tr height="25">
                            <td>
                                <span id="crmMenuBar">
                                    <table cellspacing="0" cellpadding="0" width="100%">
                                        <tbody>
                                            <tr>
                                                <td>
                                                    <table class="ms-crm-ActionBar" id="mnuBar1" cellspacing="0" cellpadding="0">
                                                        <tbody>
                                                            <tr>
                                                                <td class="ms-crm-MenuBar-Items" nowrap align="right">
                                                                    <ul class="ms-crm-MenuBar-Left">
                                                                        <li class="ms-crm-Menu" id="_MBlocAddRelatedToNonForm1010GUID" title="新增条目" onclick="window.execScript(action)"
                                                                            tabindex="-1" action="OpenDia('add');"><span class="ms-crm-Menu-Label"><a class="ms-crm-Menu-Label"
                                                                                onclick="return false;" tabindex="-1" href="javascript:onclick();" target="_self">
                                                                                <img class="ms-crm-Menu-ButtonFirst" tabindex="-1" alt="新增条目" src="../_imgs/ico_18_4002.gif"><span
                                                                                    class="ms-crm-MenuItem-TextRTL" tabindex="0">新增</span></a></span></li>
                                                                        <li class="ms-crm-Menu-Spacer" tabindex="-1">&nbsp;<img id="ImgUpdate" style="background-position-y: -55px;
                                                                            background-image: url(../_imgs/imagestrips/control_imgs_1.gif); width: 4px; clip: rect(0px 4px 17px 0px);
                                                                            height: 17px" alt="" src="../_imgs/imagestrips/transparent_spacer.gif">&nbsp;</li>
                                                                        <li class="ms-crm-Menu" id="_MBUpdateUser" title="修改文件条目" onclick="window.execScript(action)"
                                                                            tabindex="-1" action="OpenDia('modify');"><span class="ms-crm-Menu-Label"><a class="ms-crm-Menu-Label"
                                                                                onclick="return false;" tabindex="-1" href="javascript:onclick();" target="_self"
                                                                                style="cursor: pointer;">
                                                                                <img class="ms-crm-Menu-ButtonFirst" id="ImgUpdateUser" style="width: 16px; height: 16px"
                                                                                    tabindex="0" alt="修改文件条目" src="../_imgs/ico_16_4207_d.gif"><span class="ms-crm-MenuItem-TextRTL"
                                                                                        tabindex="0">修改</span></a></span></li>
                                                                        <li class="ms-crm-Menu-Spacer" tabindex="-1">&nbsp;<img id="Img2" style="background-position-y: -55px;
                                                                            background-image: url(../_imgs/imagestrips/control_imgs_1.gif); width: 4px; clip: rect(0px 4px 17px 0px);
                                                                            height: 17px" alt="" src="../_imgs/imagestrips/transparent_spacer.gif">&nbsp;</li>
                                                                        <li class="ms-crm-Menu" id="_MBdoActioncrmGrid1036delete" title="删除条目" onclick="window.execScript(action)"
                                                                            tabindex="-1" action="DoAction('delete');"><span class="ms-crm-Menu-Label"><a class="ms-crm-Menu-Label"
                                                                                onclick="return false;" tabindex="-1" href="javascript:onclick();" target="_self">
                                                                                <img class="ms-crm-Menu-ButtonFirst" id="ico_16_delete" style="background-position-y: -121px;
                                                                                    background-image: url(../_imgs/imagestrips/grid_ctrl_imgs.gif); width: 16px;
                                                                                    clip: rect(0px 16px 16px 0px); height: 16px" tabindex="0" alt="删除条目" src="../_imgs/imagestrips/transparent_spacer.gif"><span
                                                                                        class="ms-crm-MenuItem-TextRTL" tabindex="0">删除条目</span></a></span></li>
                                                                    </ul>
                                                                </td>
                                                                <td class="ms-crm-MenuBar-Items ms-crm-Menu-ICRight" nowrap>
                                                                    <ul class="ms-crm-MenuBar-Right">
                                                                    </ul>
                                                                </td>
                                                            </tr>
                                                        </tbody>
                                                    </table>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </span>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div id="divloading" style="display: none;">
                                    <table class="stdTable" style="background-color: #FFFFFF; border: solid 1px #6699CC;"
                                        cellpadding="0" cellspacing="0">
                                        <tr>
                                            <td style="vertical-align: middle" align="center">
                                                <img src="../_imgs/AdvFind/progress.gif" /><br />
                                                加载数据 ...</td>
                                        </tr>
                                    </table>
                                </div>
                                <div id="divItemsList">
                                </div>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </form>
</body>
</html>
